<template>
  <div>
    <!--        评论填写框-->
    <el-input v-model="input" placeholder="写下你的评论...">
      <el-button @click="submitChileComment()" type="primary" slot="append" plain>发布
      </el-button>
    </el-input>
  </div>
</template>

<script>
import axios from 'axios'
import Qs from 'qs'

export default {
  name: 'CommentReply',
  data () {
    return {
      input: ''
    }
  },
  props: ['commentId', 'senderId', 'receiverId', 'articleId'],
  methods: {
    submitChileComment: function () {
      var data = Qs.stringify({
        comment: this.input,
        articleId: this.articleId,
        'sender.id': this.senderId,
        'receiver.id': this.receiverId,
        isChildrenComment: this.commentId
      })
      console.log('内容：' + this.input)
      console.log('文章id：' + this.articleId)
      console.log('评论id：' + this.commentId)
      console.log('发送者id：' + this.senderId)
      console.log('接受者Id：' + this.receiverId)
      axios.post('/comment/addCommentReply', data).then(function (res) {
        console.log(res.data)
      })
    }
  }
}
</script>

<style scoped>

</style>
